
#include "http_client_factory.h"
#include "curl_http_client.h"

using comm::http::custorm::IHttpClient;
using comm::http::custorm::CCUrlHttpClient;
using comm::http::custorm::CHttpClientFactory;

IHttpClient* CHttpClientFactory::CreateHttpClient(void)
{
    CCUrlHttpClient* pClient = new CCUrlHttpClient();
    if (pClient->Init() != 0)
    {
        m_sErrMsg = "create curl http client faieled";
        delete pClient;
        return NULL;
    }

    return pClient;
}


const std::string& CHttpClientFactory::GetLastError(void) const
{
    return m_sErrMsg;
}
